Skip to content

fix: validate the effective configuration#2352

Merged
rsynek merged 2 commits into
TimefoldAI:mainfrom
rsynek:fix/configuration-validation
Jun 11, 2026
Merged

fix: validate the effective configuration#2352
rsynek merged 2 commits into
TimefoldAI:mainfrom
rsynek:fix/configuration-validation

Conversation

@rsynek

@rsynek rsynek commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes an issue that we validate the original configuration coming from a request, but not the effective configuration that is created by merging the configuration profile with the request configuration.

Tested with a custom version of field-service-routing in the sandbox environment.

@rsynek rsynek requested a review from triceo as a code owner June 10, 2026 13:25
Copilot AI review requested due to automatic review settings June 10, 2026 13:25
@rsynek rsynek requested review from cristianonicolai and removed request for diogodanielsoaresferreira June 10, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes validation to run against the effective model configuration (the configuration after merging any stored profile/defaults with the request overrides) instead of validating only the original request configuration.

Changes:

  • Update worker-side validation to validate ModelInput against storageService.getConfiguration(id) (via Configuration.getSafeModelConfig(...)) rather than ModelRequest.getModelConfig().
  • Update REST /validation-result endpoint to validate ModelInput against the effective stored configuration instead of the request configuration.
  • Remove now-unused ModelRequest import from SolverWorker.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
model/worker/src/main/java/ai/timefold/solver/model/worker/impl/SolverWorker.java Switch validation to use stored ModelInput + effective stored configuration.
model/rest/src/main/java/ai/timefold/solver/model/rest/impl/AbstractModelAPIResource.java Switch validation endpoint to use stored ModelInput + effective stored configuration.

@rsynek rsynek force-pushed the fix/configuration-validation branch from b81d6bc to 2d4645b Compare June 10, 2026 13:33

@winklerm winklerm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks good to me!

@triceo triceo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use var consistently; both files have var only selectively, yet the code introduces lines where var is an obvious win.

I recommend configuring IntelliJ to show that as soft-warning, and then mass-fixing that on the entire file; there is a keyboard shortcut for it which I currently don't remember. :-)

LGTM when that's done.

Copilot AI review requested due to automatic review settings June 11, 2026 09:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@rsynek rsynek force-pushed the fix/configuration-validation branch from 0d035d5 to e8aeb81 Compare June 11, 2026 09:51
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube Cloud

@rsynek rsynek merged commit 1c6fb76 into TimefoldAI:main Jun 11, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants